If the old mode is metaphysical mode and the new mode is
virtual mode. set_one_rr(0, PSCB(vcpu,rrs[0]) will not
set machine region register 0, because at this time,
PSCB(vcpu,metaphysical_mode) is 1, VMM need to update
metaphysical_mode first, then call set_one_rr.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
{
/* only do something if mode changes */
if (!!newmode ^ !!PSCB(vcpu,metaphysical_mode)) {
+ PSCB(vcpu,metaphysical_mode) = newmode;
if (newmode) set_metaphysical_rr0();
else if (PSCB(vcpu,rrs[0]) != -1)
set_one_rr(0, PSCB(vcpu,rrs[0]));
- PSCB(vcpu,metaphysical_mode) = newmode;
}
}